Skip to content

Add auto rebuild trigger, PR preview, and diff-only execution#1

Merged
timtreis merged 1 commit into
mainfrom
feat/auto-rebuild-and-cleanup
May 11, 2026
Merged

Add auto rebuild trigger, PR preview, and diff-only execution#1
timtreis merged 1 commit into
mainfrom
feat/auto-rebuild-and-cleanup

Conversation

@timtreis
Copy link
Copy Markdown
Member

Summary

Adds three workflows that fully automate the end-to-end flow from notebook PR → preview → merge → docs rebuild on RTD, and trims execute-on-PR to only diff-touched notebooks.

Workflow Trigger What it does
trigger-docs-rebuild.yaml push to main POSTs RTD API to rebuild spatialdata-plot/latest. Combined with the lib's post_checkout: git submodule update --remote --recursive, propagates new content without a manual submodule-bump PR.
preview.yaml PR open/sync Builds the lib's docs against the PR's notebook content and deploys to gh-pages/pr-<N>/. Comments a preview link on the PR (updates in place on subsequent pushes).
execute.yaml PR / weekly / manual PRs now re-execute only diff-touched notebooks. Schedule + workflow_dispatch still re-run everything. Keeps CI fast as the gallery grows.

Required manual setup before merging

  1. Add RTD_TOKEN secret: generate at https://readthedocs.org/accounts/tokens/, add to this repo's Settings → Secrets → Actions. Without it, trigger-docs-rebuild.yaml skips silently and you need a manual submodule bump for new content to appear.
  2. Enable GitHub Pages: Settings → Pages → Source: Deploy from a branch, Branch: gh-pages /. Required for preview.yaml to publish PR previews.

Both can be done after merge, but features stay dormant until they are.

Test plan

  • CI green on this PR (the new workflows themselves don't run on this PR — trigger-docs-rebuild is push-only, preview requires Pages enabled, and execute runs only on changed notebooks of which there are none).
  • After merge: open a small notebook PR (e.g., a typo fix in getting_started.ipynb) and verify the preview comment appears and links to a working preview.
  • After merge + RTD_TOKEN added: push a typo fix to main, watch RTD rebuild kick off automatically.

Related

  • spatialdata-plot PR #656 (lib side: post_checkout submodule update + card gallery)
  • Closes the I1, I4, I6 follow-up items from the architecture review.

I1 — trigger-docs-rebuild.yaml
   On push to main (when notebook content changes), POST to ReadTheDocs API
   to rebuild scverse/spatialdata-plot's `latest` version. Combined with the
   lib's `post_checkout: git submodule update --remote --recursive`, this
   propagates new gallery content end-to-end without manual submodule
   bumps. Skips silently if RTD_TOKEN secret is unset.

   Required setup: add RTD_TOKEN repo secret (token from
   https://readthedocs.org/accounts/tokens/).

I4 — preview.yaml
   On every PR (touching notebook content), build the lib's docs against
   the PR's notebook content, deploy to gh-pages under pr-<N>/, and post a
   preview link comment. Updates the comment in place on subsequent pushes.

   Required setup: enable GitHub Pages on this repo (Settings -> Pages,
   source: Deploy from a branch, branch: gh-pages /).

I6 — execute.yaml: only diff-touched notebooks on PR
   Schedule + workflow_dispatch still re-execute everything; PRs now run
   only the notebooks they touched. Keeps PR feedback fast as the gallery
   grows. Mirrors sklearn's gallery CI pattern.
@timtreis timtreis merged commit d423263 into main May 11, 2026
2 checks passed
@timtreis timtreis deleted the feat/auto-rebuild-and-cleanup branch May 11, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant